from django.db import models

from app01.utils.models import BaseModel


# Create your models here.


class Push_Excel(BaseModel):
    """
    上传保存
    """
    name = models.CharField(verbose_name='excel名称', max_length=225, unique=True)
    push_excel = models.ImageField(upload_to="push_excel", verbose_name="excel")

    def __str__(self):
        return self.name


class Excel_data(BaseModel):
    """
    excel数据
    """
    name = models.CharField(verbose_name='excel名称', max_length=225)
    push_excel = models.ForeignKey(verbose_name='名称', to='Push_Excel', on_delete=models.DO_NOTHING, null=True,
                                   blank=True)
    # 数据
    department = models.CharField(verbose_name='department', max_length=225)
    work_name = models.CharField(verbose_name='work_name', max_length=225)
    Attendance_number = models.CharField(verbose_name='Attendance_number', max_length=225)
    Clock_time = models.CharField(verbose_name='Clock_time', max_length=225)

    def __str__(self):
        return self.work_name


class After_Conversion(BaseModel):
    """
    转化后的数据
    """
    pull_name = models.CharField(verbose_name='pull_name', max_length=225, null=True, blank=True, unique=True)
    pull_path = models.CharField(verbose_name='pull_path', max_length=225, null=True, blank=True)
